import { log } from '../core/logger';
import trayManager from '../core/tray';

/**
 * 显示托盘图标变更事件处理器
 * 事件名: showTrayIcon:changed
 */
export default (showTrayIcon: boolean): void => {
  log.info('处理显示托盘图标变更事件:', showTrayIcon);
  try {
    if (showTrayIcon) {
      trayManager.createTray();
    } else {
      trayManager.destroy();
    }
  } catch (error) {
    log.error('处理托盘图标变更失败:', error);
  }
};
